package com.snatch.work.service;

import com.snatch.common.vo.NodeTaskInput;
import com.snatch.common.vo.RatioDataInput;
import com.snatch.common.vo.SnatchTask;
import com.snatch.work.vo.LoginData;
import com.snatch.work.vo.SnatchDataInput;
import com.snatch.work.vo.ThirdInfo;



/**
 * 第三方抓取接口
 * 
 * @author Administrator
 * 
 */
public interface SnatchService {

	
	
	/**
	 * 初始化登录
	 * @param loginData
	 * @return
	 * @throws Exception
	 */
	public ThirdInfo connectionWeb(LoginData loginData) throws Exception;
	
	
	/**
	 * 初始化组件
	 * 
	 */
	public void init(ThirdInfo thirdInfo);
	
	/**
	 * 刷新验证码
	 * @param thirdInfo
	 * @return
	 * @throws Exception
	 */
	public boolean refreshValidateCode(ThirdInfo thirdInfo) throws Exception;
	
	/**
	 * 登录
	 * @param thirdInfo
	 * @return
	 * @throws Exception
	 */
	public int login(ThirdInfo thirdInfo) throws Exception; 
	
	/**
	 * 选择出增量或全量
	 * @param thirdInfo
	 * @return
	 * @throws Exception
	 */
	public int electSnatch(SnatchTask snatchTask) throws Exception;
	
	
	/**
	 * 全量抓取
	 * @param thirdInfo 抓取参数对象
	 * @return
	 * @throws Exception
	 */
	public SnatchDataInput getData(NodeTaskInput nodeTaskInput,ThirdInfo thirdInfo) throws Exception;
	
	
	/**
	 * 增量抓取
	 * @param thirdInfo 抓取参数对象
	 * @param snatchItem 抓取类型（gq sp）
	 * @param updateTime 更新时间
	 * @param marketID 赔率类型 （马来 香港）
	 * @return
	 * @throws Exception
	 */
	public SnatchDataInput getUpdateData(ThirdInfo thirdInfo, String collectCode, String updateTime) throws Exception;
	
	/**
	 * 
	 * @param snatchDataInput
	 * @return
	 */
	public RatioDataInput gatherData(SnatchDataInput snatchDataInput);
	
	
	/**
	 * 清理数据
	 * @param snatchItem
	 */
	public void clearData(String snatchItem);
	
	public int logout(ThirdInfo thirdInfoVO) throws Exception;
	
}
